Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slab): implement basic action operations #1

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

soonum
Copy link
Contributor

@soonum soonum commented Dec 18, 2023

This consist in a simple "start" and "stop" mode for the action.

@soonum soonum requested a review from tmontaigu December 18, 2023 16:12
@soonum soonum self-assigned this Dec 18, 2023
@soonum soonum force-pushed the dt/feat/create_action branch 6 times, most recently from 0bf6a70 to 568ee0e Compare December 19, 2023 09:54
@soonum
Copy link
Contributor Author

soonum commented Dec 19, 2023

New HTTP routes in Slab must be shipped to production before to be able to have a green CI here.

@soonum
Copy link
Contributor Author

soonum commented Jan 3, 2024

Regarding the huge number of lines in this PR, don't worry since the only files that matter are located in src/ and the README. Rest of the files are either copied from Github repository used to bootstrap JS actions or automatically generated (like in dist/ directory)

@soonum soonum requested a review from IceTDrinker January 3, 2024 09:31
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally ok, I think the objective here is to get something to test, I saw some lints failing also some things seem to need to be done to get remove task IDs ?

.prettierrc.json Show resolved Hide resolved
.prettierignore Outdated Show resolved Hide resolved
src/slab.js Outdated Show resolved Hide resolved
src/slab.js Outdated Show resolved Hide resolved
@soonum soonum force-pushed the dt/feat/create_action branch from 568ee0e to ddf7c8e Compare January 3, 2024 15:18
@IceTDrinker
Copy link
Member

maybe skip code QL if it requires paying additional stuff (looks like the workflow indicates that it is the case)

@soonum soonum force-pushed the dt/feat/create_action branch 2 times, most recently from 50faee4 to 4e9eb4a Compare January 4, 2024 10:08
@soonum soonum requested a review from IceTDrinker January 4, 2024 13:14
@soonum soonum force-pushed the dt/feat/create_action branch 13 times, most recently from 9d651d1 to 73812fc Compare January 5, 2024 14:22
@soonum soonum force-pushed the dt/feat/create_action branch 12 times, most recently from 8c66789 to 7064ffa Compare January 8, 2024 08:42
@soonum soonum force-pushed the dt/feat/create_action branch 10 times, most recently from 513f0e4 to 02d2162 Compare January 24, 2024 14:13
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things

.github/workflows/ci.yml Outdated Show resolved Hide resolved
src/slab.js Outdated Show resolved Hide resolved
}
}

async function removeTask(taskId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tasks are not auto removed by slab once done ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because one might want to know when a task is finished. Due to the asynchronous nature of such request, Slab cannot endorse the responsibility of removing a task as soon as it's done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I guess I kind of see it, but this means people calling the API need to do the clean up which seems fragile, I'm guessing it's a bit of work to get that on the Slab side but later down the line could we maybe do a query on the task status and if Slab sees that the status it returns is "done" then it removes the task on behalf of the requester

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a timeout where the task is removed eventually like after 10 minutes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want me to create an issue for this ? @soonum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agreed on your idea. That's a clever way to deal with the problem.
And yes, you can create an issue for this.

This consist in a simple "start" and "stop" mode for the action.
@soonum soonum force-pushed the dt/feat/create_action branch from 02d2162 to fd3f51f Compare January 25, 2024 08:31
@soonum soonum requested a review from IceTDrinker January 25, 2024 08:31
Comment on lines +20 to +25
if (config.input.subnetId) {
payload.subnet_id = config.input.subnetId
}
if (config.input.securityGroupIds) {
payload.security_group_ids = config.input.securityGroupIds
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those already optional in Slab ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright then

Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as they say :)

@soonum soonum merged commit 67eeef5 into main Jan 25, 2024
11 checks passed
@soonum soonum deleted the dt/feat/create_action branch January 25, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants